﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Topro.Service
{
    /// <summary>
    /// 堆垛地址
    /// </summary>
    public class StockAddr
    {
        public static string SerialNo = "D617";          //序列号地址
        public static string IsFree = "D100";            //堆垛机是否空闲地址
        public static string Work = "D101";            //工作中
        public static string Exception = "D120";         //堆垛机异常时 取异常信息地址 bit位
        public static string InDone = "D103";            //入库完成地址
        public static string OutDone = "D104";           //出库完成地址
        public static string ModeAddr = "D105";          //模式(手动(0)、自动(1))
        public static string PulseAddr = "D107";         //脉冲
        public static string CallBackFlag = "D610";      //堆垛机召回地址标识 输送线

        public static string FromPai = "D611";           //源排
        public static string FromLie = "D612";           //源列
        public static string FromCeng = "D613";          //源层

        public static string ToPai = "D614";             //目的排
        public static string ToLie = "D615";             //目的列
        public static string ToCeng = "D616";            //目的层

        public static string Ask = "D625";

        public static string Restore = "D621";            //复原

        public static string CurrentLie = "D201";        //堆垛机当前列
        public static string StockCallBackValue = "D201";//召回写值地址
        public static string AbLight;                    //异常时 堆垛机报警地址
        public static string AbTransLight;               //异常时输送线报警地址

        //public static string PlateType="D9215";               //输送线大小板地址 1小2大


    }


    /// <summary>
    /// 堆垛机站台
    /// </summary>
    public class StockStation
    {
        public int Id { get; set; }                //入口站台号
        public int Type { get; set; }              //类型
        public string Name { get; set; }              //类型
        public string SerialNoAddr { get; set; }   //读取入库暂存位流水号地址   
        public string HaveTrayAddr { get; set; }   //入库暂存位状态 是否有托盘地址
        public string PlateType { get; set; }   //大小板
        public string DirectionType { get; set; }   //方向
        public int Pai { get; set; }
        public int Lie { get; set; }
        public int Ceng { get; set; }
    }

    /// <summary>
    /// 入口
    /// </summary>
    public class InStockStation
    {
        public int Id { get; set; }                //入口站台号
        public int Type { get; set; }              //类型
        public int TargetNo { get; set; }          //目标站台
        public int TargetPai { get; set; }          //目标站台
        public int TargetLie { get; set; }          //目标站台
        public int TargetCeng { get; set; }          //目标站台
        public string SerialNoAddr { get; set; }   //读取入库暂存位流水号地址   
        public string HaveTrayAddr { get; set; }   //入库暂存位状态 是否有托盘地址
        public int Pai { get; set; }
        public int Lie { get; set; }
        public int Ceng { get; set; }
        public int Sort { get; set; }                //排序
        public int Fix { get; set; }
    }

    /// <summary>
    /// 出口
    /// </summary>
    public class OutStockStation
    {
        public int Id { get; set; }                    //出口站台号 
        public int Type { get; set; }                  //类型
        public int TargetNo { get; set; }          //目标站台
        public string SerialNoAddr { get; set; }       //PLC流水号地址
        public string HaveTrayAddr { get; set; }       //出库暂存位状态 是否有托盘地址
        public int Pai { get; set; }                //排
        public int Lie { get; set; }                //列
        public int Ceng { get; set; }               //层
        public int Sort { get; set; }              //排序
        public int Fix { get; set; }
        public int TargetPai { get; set; }          //目标排
        public int TargetLie { get; set; }          //目标列
        public int TargetCeng { get; set; }          //目标层
    }

    /// <summary>
    /// 扫码器
    /// </summary>
    public class BCRStation
    {
        public int Id { get; set; }                   //编号
        public string ServerIp { get; set; }          //服务器Ip
        public string ServerProt { get; set; }        //服务器端口
        public string SerialNoAddr { get; set; }      //流水号地址
        public string TargetAddr { get; set; }        //目标地址
        public string ExceptionAddr { get; set; }     //异常消息地址
        public string ExitAddr { get; set; }          //退出写值地址
        public string TrayAddr { get; set; }          //监测有是否有托盘地址
        public string BarCode { get; set; }           //条码
        public int Type { get; set; }                 //类型(空托盘、实托盘)
        public int ContainerType { get; set; }        //容器类型(毛坯库、半成品库、成品库)
        public int Sort { get; set; }                 //排序
    }

    /// <summary>
    /// 预叠
    /// </summary>
    public class PreStack
    {
        public int Id { get; set; }                    //出口站台号 
        public string SerialNoAddr { get; set; }       //PLC流水号地址
        public string HaveTrayAddr { get; set; }       //出库暂存位状态 是否有托盘地址
        public int Pai { get; set; }
        public int Lie { get; set; }
        public int Ceng { get; set; }
    }
}
